#ifndef NSTRING_H
#define NSTRING_H

#include "standard/standard.h"
#include "stdafx.h"


#if defined(_MSC_VER)
#define DIRECTORY_SEPARATOR		"\\"
#elif defined(__GNUC__)
#define DIRECTORY_SEPARATOR		"/"
#endif

STANDARD_API std::string _U( const std::string str );

#if defined(_MSC_VER)
STANDARD_API std::wstring ANSIToUnicode(const std::string &str );
STANDARD_API std::string UnicodeToANSI(const std::wstring &str );
STANDARD_API std::wstring UTF8ToUnicode(const std::string &str );
STANDARD_API std::string UnicodeToUTF8(const std::wstring &str );
#endif

#if defined(__GNUC__)
std::string u2g(const std::string &str);
std::string g2u(const std::string &str);
int enc_utf8_to_unicode_one(const unsigned char* pInput, unsigned long *Unic);
int enc_utf8_to_unicode(const unsigned char* pInput, int nMembIn, unsigned long* pOutput, int* nMembOut);
int enc_utf8_to_unicode_str(const unsigned char *pInput, unsigned long *pOutput, int *nMembOut);
int enc_unicode_to_utf8_one(unsigned long unic, unsigned char *pOutput, int outSize);
int enc_unicode_to_utf8_str(const unsigned long *pInput, unsigned char *pOutput, int *nMembOut);
#endif

STANDARD_API	int  gbktoutf8(vecStr * vsend);

STANDARD_API std::string   Substrlen(std::string str,int num);
STANDARD_API std::string& tolower_str(std::string& str);
STANDARD_API int stoi(std::string& s);
STANDARD_API long unsigned int stol(std::string& s);

STANDARD_API std::string itos(std::string::size_type& n);
STANDARD_API std::string itos(int& n);
STANDARD_API std::string itos(short int n);

STANDARD_API std::string ultos(unsigned long int n);
STANDARD_API std::string ltos(long int n);
STANDARD_API char * itoa(int& n);
STANDARD_API int is_numeric(std::string& str);
STANDARD_API std::string trim(std::string& str, bool flag);
STANDARD_API std::string trim(std::string& str);
STANDARD_API vectorStr explode(const std::string &delimiter, const std::string &str);
STANDARD_API  std::string implode(const std::string &delimiter, vectorStr &arr);
STANDARD_API int getArr(mapStrStr& getarr, std::string& recvstr);
STANDARD_API unsigned long int send_data_format(std::string &s,const char *fmt, va_list *vp);

#endif
